
import {simpleServer} from '@/tools/servers'

/**
 * 商品类型
 */
export class GoodsTypeService {
    // 分页查询列表
    static findGoodsTypes (pageDTO) {
        var httpMethod = 'POST';
        var body = simpleServer.getArgs(this.findGoodsTypes,arguments,'POST');
        return simpleServer.connection(httpMethod, '/simple/goods/GoodsType/findGoodsTypes', body);
    }


    //根据商品类型Id查询商品类型
    static findGoodsType (goodsTypeId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findGoodsType ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/goods/GoodsType/findGoodsType',body);
    }

    //为了编辑,根据商品类型Id查询商品类型
    static findGoodsTypeForEdit(goodsTypeId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findGoodsTypeForEdit ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/goods/GoodsType/findGoodsTypeForEdit',body);
    }

    //为了查看,根据商品类型Id查询商品类型，所有外键字段的名称都已加载
    static findGoodsTypeForView(goodsTypeId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findGoodsTypeForView ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/goods/GoodsType/findGoodsTypeForView',body);
    }

    //创建新的商品类型
    static createGoodsType() {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.createGoodsType,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/goods/GoodsType/createGoodsType',body);
    }

    //保存商品类型
    static saveGoodsType(goodsType) {
        var httpMethod = 'POST';
        var body = simpleServer.getArgs(this.saveGoodsType,arguments,'POST');
        return simpleServer.connection(httpMethod, '/simple/goods/GoodsType/saveGoodsType', body);
    }

    //编辑商品类型
    static updateGoodsType (goodsType) {
        var httpMethod = 'POST';
        var body = simpleServer.getArgs(this.updateGoodsType,arguments,'POST');
        return simpleServer.connection(httpMethod, '/simple/goods/GoodsType/updateGoodsType', body);
    }

    //根据商品类型Id删除商品类型
    static deleteGoodsType (goodsTypeId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.deleteGoodsType,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/goods/GoodsType/deleteGoodsType',body);
    }

    //为了查看,根据商品类型Id查询商品类型，只加载ID 和 名称
    static findGoodsTypesWithIdNameById(goodsTypeId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findGoodsTypesWithIdNameById ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/goods/GoodsType/findGoodsTypesWithIdNameById',body);
    }

    //为了查看,根据商品类型 名称 查询商品类型，只加载ID 和 名称
    static findGoodsTypesWithIdNameByName(goodsTypeName) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findGoodsTypesWithIdNameByName ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/goods/GoodsType/findGoodsTypesWithIdNameByName',body);
    }


}
